package com.sqin.taskflow.tasks;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;


@Slf4j
@Data
public class SuccessTask implements JavaDelegate {
    //定义一些属性，流程中可以指定这些属性信息值


    @Override
    public void execute(DelegateExecution execution) {
        Object lock = new Object();
        synchronized (lock){
            log.info("准备调用wait..");
            try {
                    lock.wait(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                log.info("被唤醒");
            }

        log.info("流程 {}-{}-{} 执行到ServiceTask，处理业务数据.",
                execution.getProcessDefinitionId()
                ,execution.getParentId(),execution.getCurrentActivityId());

    }
}
